<?php

namespace ManiaLivePlugins\MLEPP\ManiaRecords\Runnables;

Class Init extends \ManiaLive\Threading\Runnable {
    
    public $serverLogin = "";
    
    function run() {
        
        
        $curl = curl_init("http://api.trackmaniaserver.org/redirector.php?get=apihost");
        curl_setopt($curl, CURLOPT_REFERER, $this->serverLogin);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);      
        $body = curl_exec($curl);
        
        if (empty($body)) {
            return false;
        } else {
            return trim($body);
        }
    }

}

?>